const Koa = require("koa");
const app = new Koa();
const Router = require("koa-router");
const router = new Router();

const koaBody = require("koa-body");
app.use(koaBody());

//注册
router.post("/user/signup", ctx => {
  const email = ctx.request.body.email;
  const pwd = ctx.request.body.pwd;
  const captcha = ctx.request.body.captcha;
  const emailCode = ctx.request.body.emailCode;
  const name = ctx.request.body.name;
  const domainSuffix = ctx.request.body.domainSuffix;
  console.log(JSON.stringify(ctx.request.body));
  ctx.body = JSON.stringify(ctx.request.body);
});

app.use(router.routes()).use(router.allowedMethods());

app.listen(3000);
